package org.libcsp.generic.db.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;
import org.libcsp.generic.db.annotation.FieldDescription;
import org.libcsp.generic.db.annotation.TableDescription;

import java.io.Serializable;


@Getter
@Setter
@TableDescription(name = "entity", comment = "所有表父类")
public class Entity implements Serializable {

    @FieldDescription(name = "serial_id", type = "serial8", length = 8, allowNull = false, primaryKey = true, comment = "自增序列")
    @TableId(value = "serial_id", type = IdType.AUTO)
    private Long serialId;

    @FieldDescription(name = "remark", type = "varchar", length = 256, comment = "备注")
    @TableField("remark")
    private String remark;

    @FieldDescription(name = "create_date", type = "varchar", length = 10, allowNull = false, comment = "日期yyyy-MM-dd")
    @TableField("create_date")
    private String createDate;

    @FieldDescription(name = "create_time", type = "varchar", length = 16, allowNull = false, comment = "时间,描述保留后几位小数")
    @TableField("create_time")
    private String createTime;

    @FieldDescription(name = "creator", type = "varchar", length = 32, comment = "创建人")
    @TableField("creator")
    private String creator;

    @FieldDescription(name = "update_date", type = "varchar", length = 10, allowNull = false, comment = "日期yyyy-MM-dd")
    @TableField("update_date")
    private String updateDate;

    @FieldDescription(name = "update_time", type = "varchar", length = 16, allowNull = false, comment = "时间,描述保留后几位小数")
    @TableField("update_time")
    private String updateTime;

    @FieldDescription(name = "updater", type = "varchar", length = 32, comment = "更新人")
    @TableField("updater")
    private String updater;


    @FieldDescription(name = "bgGray", type = "varchar", length = 32, comment = "蓝绿发布标识",
            dict = """
                    blue: 蓝环境
                    green: 绿环境
                    """
    )
    @TableField("bgGray")
    private String bgGray;


    @FieldDescription(name = "status", type = "int", length = 4, comment = "状态",
            dict = """
                    0: 失效
                    1: 有效
                    """
    )
    @TableField("status")
    private Integer status;
}
